
<title>消息详情</title>

<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a lay-href="message/">消息中心</a>
    <a><cite>详情</cite></a>
  </div>
</div>

<div class="layui-fluid" id="LAY-app-message-detail">
  <div class="layui-card layuiAdmin-msg-detail">
  </div>
</div>

<script>
layui.use(['admin'], function(){
  var $ = layui.$
  ,admin = layui.admin
  ,table = layui.table
  ,layer = layui.layer
  ,element = layui.element;
  
  admin.req({
    url: layui.setter.baseUrl + '/message/get',
    data:{id:layui.router().search.id},
    error: function(err){
      layer.alert(err,{title:"请求失败"})
    },
    success: function(res){
      if(res.code == 0){
        $('.layuiAdmin-msg-detail').html(
          `
          <div class="layui-card-header">
            <h1>${res.data.title}</h1>
            <p>
              <span>${layui.util.toDateString(res.data.createTime)}</span>
            </p>
          </div>
          <div class="layui-card-body layui-text">
            <div class="layadmin-text">
              ${ res.data.message }
            </div>
            <div style="padding-top: 30px;">
              <a lay-href="message/" class="layui-btn layui-btn-primary layui-btn-sm">返回上级</a>
            </div>
          </div>

          `
        )
      }else {
        layer.alert({title:"请求成功，获取数据失败"})
      }
    }
  })
  
});
</script>